module Encoder #(
    parameter IN_WIDTH  = 16,
    parameter OUT_WIDTH = 4
) (
    input   logic [IN_WIDTH-1:0]    in,
    output  logic [OUT_WIDTH-1:0]   out
);
    logic [OUT_WIDTH-1:0]   temp;
    integer i;
    always_comb begin
        temp = 0;
        for (i = 0; i < IN_WIDTH; i = i + 1) begin
            if (in[i] == 1) begin
                /* verilator lint_off WIDTH */
                temp = i;
                break;
            end
        end
        out = temp;
    end

endmodule
